home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 December / maximum-cd-2009-12.iso / DiscContents / gimp-2.7.0-i686-setup.exe / {app} / share / gimp / 2.0 / scripts / flatland.scm < prev    next >
Encoding:
Text File  |  2009-08-19  |  2.5 KB  |  76 lines

  1.  
  2. ; GIMP - The GNU Image Manipulation Program
  3. ; Copyright (C) 1995 Spencer Kimball and Peter Mattis
  4. ;
  5. ; FlatLand - creates a tileable pattern that looks like a map
  6. ; Copyright (C) 1997 Adrian Likins
  7. ;
  8. ; This program is free software: you can redistribute it and/or modify
  9. ; it under the terms of the GNU General Public License as published by
  10. ; the Free Software Foundation; either version 3 of the License, or
  11. ; (at your option) any later version.
  12. ;
  13. ; This program is distributed in the hope that it will be useful,
  14. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. ; GNU General Public License for more details.
  17. ;
  18. ; You should have received a copy of the GNU General Public License
  19. ; along with this program.  If not, see <http://www.gnu.org/licenses/>.
  20.  
  21. ;
  22. ; FlatLand
  23. ;
  24. ;    When used with the Land gradient It produces a tileble pattern that
  25. ;    looks a lot like a map.
  26. ;
  27. ;    Should be really cool once map-sphere starts working again.
  28. ;
  29. ;    To use: open gradient editor, load the Land gradient then run the script.
  30. ;
  31. ;     Adrian Likins <aklikins@eos.ncsu.edu>
  32. ;
  33.  
  34.  
  35. (define (script-fu-flatland width height seed detail xscale yscale)
  36.   (let* (
  37.         (img (car (gimp-image-new width height RGB)))
  38.         (layer-one (car (gimp-layer-new img width height
  39.                                         RGB-IMAGE "bottom" 100 NORMAL-MODE)))
  40.         (layer-two 0)
  41.         )
  42.  
  43.     (gimp-image-undo-disable img)
  44.     (gimp-image-add-layer img layer-one 0)
  45.    ; (gimp-img-add-layer img layer-two 1)
  46.  
  47.     (plug-in-solid-noise RUN-NONINTERACTIVE img layer-one 1 0 seed detail xscale yscale )
  48.     (plug-in-c-astretch RUN-NONINTERACTIVE img layer-one)
  49.     (set! layer-two (car (gimp-layer-copy layer-one TRUE)))
  50.     (gimp-image-add-layer img layer-two -1)
  51.     (gimp-image-set-active-layer img layer-two)
  52.  
  53.     (plug-in-gradmap RUN-NONINTERACTIVE img layer-two)
  54.     (gimp-image-undo-enable img)
  55.     (gimp-display-new img)
  56.   )
  57. )
  58.  
  59. (script-fu-register "script-fu-flatland"
  60.   _"_Flatland..."
  61.   _"Create an image filled with a Land Pattern"
  62.   "Adrian Likins <aklikins@eos.ncsu.edu>"
  63.   "Adrian Likins"
  64.   "1997"
  65.   ""
  66.   SF-ADJUSTMENT _"Image width"  '(256 10 2000 1 10 0 1)
  67.   SF-ADJUSTMENT _"Image height" '(256 10 2000 1 10 0 1)
  68.   SF-ADJUSTMENT _"Random seed"  '(80 1 2000000 1 10 0 1)
  69.   SF-ADJUSTMENT _"Detail level" '(3 1 15 1 10 1 0)
  70.   SF-ADJUSTMENT _"Scale X"      '(4 0.1 16 0.1 2 1 1)
  71.   SF-ADJUSTMENT _"Scale Y"      '(4 0.1 16 0.1 2 1 1)
  72. )
  73.  
  74. (script-fu-menu-register "script-fu-flatland"
  75.                          "<Image>/File/Create/Patterns")
  76.